package com.aurora.supermarket.util;

import android.graphics.Bitmap;

import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import com.hys.utils.ImageUtils;

import java.security.MessageDigest;

public class GlideRoundCornerTransform extends BitmapTransformation {

    public GlideRoundCornerTransform() {
        super();
    }

    @Override

    protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {

        return roundCornerCrop(pool, toTransform);

    }

    private static Bitmap roundCornerCrop(BitmapPool pool, Bitmap source) {
        return ImageUtils.toRoundCorner(source,15,true);
    }

    @Override

    public void updateDiskCacheKey(MessageDigest messageDigest) {
    }

}

